<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="init.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<title></title>
		<script src="${ctx}/plugins/fckeditor/fckeditor.js"
			type="text/javascript"></script>
		<script src="${ctx}/plugins/My97DatePicker/WdatePicker.js"
			type="text/javascript"></script>
<script type="text/javascript">
jQuery(document).ready(function() {
	initFckEditor();
});
 //检测内容
 function checkContent() {
 	var channelId = jQuery("#channelId").val();
 	var title = jQuery("#title").val();
 	var msg = "";
 	if(channelId == "") {
		msg = "栏目不能为空!";
 	} else if(title == "") {
 		msg = "标题不能为空!";
 	} 
 	
 	if(msg!=""){
 		jAlert(msg,"系统提示");
 	}else {
 		jQuery("#jvForm").submit();
 	}
 }
</script>
	</head>
	<body>
		<div class="body-box">
			<div class="rhead">
				<div class="rpos">
					当前位置: 内容管理
				</div>
				<form class="ropt">
					<input type="submit" value="返回列表"
						onclick="this.form.action='news.action';" />
					<input type='hidden' name='page.pageNo' id='pageNo' value="${page.pageNo }" />
				</form>
				<div class="clear"></div>
			</div>


			<form method="post" action="news!save.action" id="jvForm">
				<input type="hidden" name="id" value="${id }"/>
				<input type='hidden' name='page.pageNo' value="${page.pageNo }" />
				<table width="100%" class="pn-ftable" cellpadding="2"
					cellspacing="1" border="0">
					<tr>


						<td width="10%" class="pn-flabel pn-flabel-h">
							<span class="pn-frequired">*</span>栏目:
						</td>
						<td colspan="3" width="90%" class="pn-fcontent">
							<div style="float: left">
								<div>
									<s:select name="channel.id" id="channelId"
										list="allChannel" listKey="id"
										listValue="name" headerKey="" value="channel.id"
										headerValue="--请选择--" theme="simple" cssStyle="width:122px" >
									</s:select>
									
									<span class="pn-fhelp">请选择栏目</span>
								</div>
							</div>
						</td>
					</tr>



					<tr id="tr-title">
						<td width="10%" class="pn-flabel pn-flabel-h">
							<span class="pn-frequired">*</span>标题:
						</td>
						<td colspan="3" width="90%" class="pn-fcontent">
							<input type="text" maxlength="150" value="${title }"
								name="title"  class="required" size="70" maxlength="150" />
						</td>




					</tr>
					<tr id="tr-txt">
						<td width="10%" class="pn-flabel pn-flabel-h">
							内容:
						</td>
						<td colspan="3" width="90%" class="pn-fcontent">
	<script type="text/javascript">
		function initFckEditor() {
			var editorBasePath="${ctx}/plugins/fckeditor/";
			//var filemanager=editorBasePath +"editor/filemanager/browser/default/browser.html";
			var txt = new FCKeditor("content");
			txt.BasePath = editorBasePath;
			txt.Config["CustomConfigurationsPath"]="${ctx}/plugins/fckeditor/myconfig.js";
			
			//txt.Config["LinkBrowser"] = true ;
			//txt.Config["ImageBrowser"] = true ;
			//txt.Config["FlashBrowser"] = true ;
			//txt.Config["MediaBrowser"] = true ;
			
			//txt.Config["LinkBrowserURL"]  = filemanager+"?Connector=${ctx}/admin/cms/connector.action" ;
			//txt.Config["ImageBrowserURL"] = filemanager+"?Type=Image&Connector=${ctx}/admin/cms/connector.action" ;
			//txt.Config["FlashBrowserURL"] = filemanager+"?Type=Flash&Connector=${ctx}/admin/cms/connector.action" ;
			//txt.Config["MediaBrowserURL"] = filemanager+"?Type=Media&Connector=${ctx}/admin/cms/connector.action" ;
			
			txt.Config["LinkUpload"] = true ;
			txt.Config["ImageUpload"] = true ;
			txt.Config["FlashUpload"] = true ;
			txt.Config["MediaUpload"] = true ;
			
			txt.Config["LinkUploadURL"] = "${ctx}/admin/upload.action" ;
			txt.Config["ImageUploadURL"] = "${ctx}/admin/upload.action?Type=Image" ;
			txt.Config["FlashUploadURL"] = "${ctx}/admin/upload.action?Type=Flash" ;
			txt.Config["MediaUploadURL"] = "${ctx}/admin/upload.action?Type=Media" ;
			
			txt.ToolbarSet="My";
			txt.Height=400;
			
			//txt.Create();
			txt.ReplaceTextarea() ;
		}
</script>

<textarea id="content" name="content">${content}</textarea>
						</td>


					</tr>
					<tr>

						<td colspan="4" class="pn-fbutton">
							<input type="button" onclick="checkContent();" value="提交" />
							&nbsp;
							<input type="reset" value="重置" />
							</div>
							</td></tr></table></form></div>
	</body>
</html>